<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring3-3.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
    <head th:include="admin/template :: header" />
    <body>
        <div class="container">
            <div th:substituteby="admin/template :: nav" />       
            <div id="message" class="alert alert-error" th:text="${message}" th:if="${message}">
                <button type="button" class="close" data-dismiss="alert">×</button>
            </div>
            <legend th:inline="text">Cập nhật thông tin người dùng: [[${username}]]</legend>
            <form class="form-horizontal bs-docs-example" th:action="@{/admin/management/user/update}">
                <!-- Form Name -->

                <!--hidden -->
                <input type="hidden" id="username" name="username" th:value="${username}"/>

                <!-- Text input-->
                <div class="form-group">
                    <label class="col-md-4 control-label" for="password">Mật Khẩu Mới</label>
                    <div class="col-md-5">
                        <input id="password" name="password" type="text" placeholder="Không cập nhật bỏ trống" class="form-control validate[required]">
                        </input>
                    </div>
                </div>

                <!-- Select Basic -->
                <div class="form-group">
                    <label class="col-md-4 control-label" for="rolename">Phân Quyền</label>
                    <div class="col-md-5">
                        <select id="rolename" name="rolename" class="form-control validate[required]">
                            <option th:text="${role.rolename}" th:value="${role.rolename}" th:each="role : ${roles}"/>
                        </select>
                    </div>
                </div>

                <!-- Button (Double) -->
                <div class="form-group">
                    <label class="col-md-4 control-label" for="submit"></label>
                    <div class="col-md-5">
                        <button id="submit" name="submit" class="btn btn-primary">Lưu Lại</button>
                        <a th:href="@{/admin/management/user/index}" id="cancel" name="cancel" class="btn btn-default">Thoát</a>
                    </div>
                </div>
            </form>

            <div th:include="admin/template :: footer"></div>
        </div>	
        <!--<script src="" th:src="@{/media/js/admin/admin_user_edit.js}"></script>-->            
        <script th:inline="javascript">
            /*<![CDATA[*/
            jQuery(document).ready(function() {
                jQuery("#form-horizontal").validationEngine();
                COMMON.activeMenu("quanly_nav");
                $("#rolename").val([[${rolename}]]);
            });
            /*]]>*/
        </script>    
    </body>
</html>